BaseComplexIndicator
The base indicator, built in form of several indicators combination.
Inherits: BaseIndicator
Implements: IComplexIndicator, IIndicator, IAsyncPersistable
Constructors
protected BaseComplexIndicator(IIndicator[] innerIndicators)
baseComplexIndicator = BaseComplexIndicator(innerIndicators)
Initializes a new instance of the BaseComplexIndicator.
- innerIndicators
- Embedded indicators.
Properties
public IReadOnlyList<IIndicator> InnerIndicators { get; }
value = baseComplexIndicator.InnerIndicators
Embedded indicators.
public ComplexIndicatorModes Mode { get; protected set; }
value = baseComplexIndicator.Mode
baseComplexIndicator.Mode = value
Embedded indicators processing mode. The default equals to Parallel.
public override int NumValuesToInitialize { get; }
value = baseComplexIndicator.NumValuesToInitialize
Number of values that need to be processed in order for the indicator to initialize (be IsFormed equals ). if undefined.
Methods
protected void AddInner(IIndicator inner)
baseComplexIndicator.AddInner(inner)
Add to InnerIndicators.
- inner
- Indicator.
protected override bool CalcIsFormed()
result = baseComplexIndicator.CalcIsFormed()
Calc IsFormed.
Returns: IsFormed
protected abstract TValue CreateValue(DateTime time)
result = baseComplexIndicator.CreateValue(time)
Create .
- time
- Time
public override Task LoadAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = baseComplexIndicator.LoadAsync(storage, cancellationToken)
Load settings.
- storage
- Settings storage.
- cancellationToken
- CancellationToken
Returns: Task
protected override IIndicatorValue OnCreateValue(DateTime time)
result = baseComplexIndicator.OnCreateValue(time)
Create a new instance of IIndicatorValue for the specified time.
- time
- Time
Returns: IIndicatorValue
protected override IIndicatorValue OnProcess(IIndicatorValue input)
result = baseComplexIndicator.OnProcess(input)
To handle the input value.
- input
- The input value.
Returns: The resulting value.
public override ValueTask PrepareAsync(CancellationToken cancellationToken)
result = baseComplexIndicator.PrepareAsync(cancellationToken)
Prepare the indicator for IIndicatorValue): do what has to be awaited before the first value.
- cancellationToken
- CancellationToken
Returns: ValueTask
public override IIndicatorValue Process(IIndicatorValue input)
result = baseComplexIndicator.Process(input)
To handle the input value.
- input
- The input value.
Returns: The new value of the indicator.
protected void RemoveInner(IIndicator inner)
baseComplexIndicator.RemoveInner(inner)
Remove from InnerIndicators.
- inner
- Indicator.
public override Task SaveAsync(SettingsStorage storage, CancellationToken cancellationToken)
result = baseComplexIndicator.SaveAsync(storage, cancellationToken)
Save settings.
- storage
- Settings storage.
- cancellationToken
- CancellationToken
Returns: Task